//导入env配置中的端口号
const { APP_PORT } = require('./config/config.default')

const app = require('./app')

// app.use((ctx, next) => {
//   ctx.body = `${APP_PORT}`
//   //ctx.body = ctx
// })

const models = require('./dbModel/init-models')

// console.log(models)

//导入测试模块
const initTest = require('./test/init')
const testRouter = require('./test')

//使用所有的路由规则,
app.use(testRouter.routes()).use(testRouter.allowedMethods())

app.listen(APP_PORT, () => {
  console.log(`serve is running on http://localhost:${APP_PORT}`)
})
